﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>@ViewBag.Title</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta name="language" content="english" />
  <meta name="viewport" content="width=device-width" />
  @{ 
    Html.RequiresCss("Mobile.css", "Layout", 0);
  }
  @MvcHtmlString.Create(Html.RenderCssHere(new List<IClientDependencyPath> {
      new BasicPath("Layout", "/Content/Styles/Layout")
    }))
  @RenderSection("Meta", required: false)
  @MvcHtmlString.Create(Html.Settings().HtmlHead)
</head>
<body>
  <div class="top">
    <div class="header">
      <a class="logo" href="@Html.Qualify("/")" title="@Html.Settings().SiteTitle">@Html.Settings().SiteTitle</a>
    </div>
    <div class="nav">
      <ul>
        @MvcHtmlString.Create(Html.Settings().MainLinks)
        @if (ViewData.IsLoggedIn()) {
        <li>@Html.AdminActionLink("New Post", "Edit", "WikiAdmin")</li>
        <li>@Html.AdminActionLink("Admin", "Index", "Admin")</li>
        <li>@Html.AdminActionLink("Logout", "Logout", "Login")</li>
        }
      </ul>
    </div>
  </div>
  <div class="body">
    @if (TempData.ContainsKey("Flash")) {
    <div class="flash">
      <p>@TempData["Flash"]</p>
    </div>
    }
    @if (IsSectionDefined("Summary")) {
    <div class="intro" runat="server" id="_summary">
      @RenderSection("Summary", required: false)
    </div>
    }
    <div class="content">
      @RenderBody()
    </div>
  </div>
  <div class="footer">
    @MvcHtmlString.Create(Html.Settings().Footer)
  </div>
  @{ 
    Html.RequiresJs("JQuery/jquery-1.3.2.min.js", "Scripts", 0);
    Html.RequiresJs("JQuery/jsdate.js", "Scripts", 1);
    Html.RequiresJs("Prettify/Prettify.js", "Scripts", 1);
    Html.RequiresJs("Showdown/Showdown.js", "Scripts", 1);
    Html.RequiresJs("Showdown/wmd.js", "Scripts", 1);
    Html.RequiresJs("Site/Site.js", "Scripts", 1);
  }
  @MvcHtmlString.Create(Html.RenderJsHere(new BasicPath("Scripts", "/Content/Scripts")))
  @MvcHtmlString.Create(Html.Settings().HtmlFooter)
    @if(Html.Settings().EnableAnalytics && !Request.IsAuthenticated && !Request.IsLocal)
  { 
   <script type="text/javascript">
       var _gaq = _gaq || [];
       _gaq.push(['_setAccount', '@Html.Settings().AnalyticsKey']);
       _gaq.push(['_trackPageview']);

       (function () {
           var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
           ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
           var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
       })();
  </script>
  }
</body>
</html>
